
{[include file="mold/mold/_view.tpl"]}

<fieldset>
<legend>生产计划</legend>
  <table width="100%">
	<tr>
		<td width="20%" align="right">工件：</td>
		<td width="30%">{[$plan.piece]}</td>
		<td width="20%" align="right">状态：</td>
		<td width="30%">{[$plan.status_t]}</td>			
	</tr>
	<tr>
		<td align="right">工艺：</td>
		<td>{[$plan.technics]}</td>
		<td align="right">负责人：</td>
		<td>{[$plan.emp_t]}</td>
	</tr>
	<tr>
		<td align="right">备注：</td>
		<td colspan="3">{[$plan.content|nl2br]}</td>
	</tr>
	{[if $plan.reason ne '']}
	<tr>
		<td align="right">变更原因：</td>
		<td colspan="3">{[$plan.reason|nl2br]}</td>
	</tr>
	{[/if]}
	<tr>
		<td align="right">计划时间：</td>
		<td>{[$plan.t1]} 至 {[$plan.t2]}</td>
		<td align="right">创建时间：</td>
		<td>{[$plan.createtime]}</td>			
	</tr>
	<tr>
	  <td align="right">计划工时：</td>
	  <td>{[$plan.hour]}小时{[$plan.minute]}分钟</td>
	  <td align="right">更新时间：</td>
	  <td>{[$plan.modifytime]} </td>
	</tr>
  </table>
</fieldset>

<fieldset>
<legend>生产信息</legend>
  <table width="100%">
	<tr>
		<td width="20%" align="right">工件：</td>
		<td width="30%">{[$result.piece]}</td>
		<td width="20%" align="right">状态：</td>
		<td width="30%">{[$result.status_t]}</td>			
	</tr>
	<tr>
		<td align="right">工艺：</td>
		<td>{[$result.technics]}</td>
		<td align="right">负责人：</td>
		<td>{[$result.emp_t]}</td>
	</tr>
	{[if $result.filename ne '']}
	<tr>
		<td align="right">附件：</td>
		<td colspan="3"><a href="{[$result.file]}" target="_blank">[下载]</a></td>
	</tr>
	{[/if]}
	<tr>
		<td align="right">工作内容：</td>
		<td colspan="3">{[$result.content|nl2br]}</td>
	</tr>
	<tr>
		<td align="right">实际日期：</td>
		<td>{[$result.t1]} 至 {[$result.t2]}</td>
		<td align="right">创建时间：</td>
		<td>{[$result.createtime]}</td>
	</tr>
	<tr>
		<td align="right">实际工时：</td>
		<td>{[$result.hour]}小时{[$result.minute]}分钟</td>
		<td align="right">更新时间：</td>
	  <td>{[$result.modifytime]} </td>
	</tr>
	
	{[if $result.quality ne '']}
	<tr>
		<td align="right"></td>
		<td></td>
		<td align="right">质检员：</td>
	  <td>{[$result.quality_t]}</td>
	</tr>
	{[/if]}

	{[if ($smarty.session.dept eq 'mjqc' or $smarty.session.code eq 'admin') and $result.status lt 4]}
	<tr>
	  <td align="right"></td>
	  <td colspan="3">
	  <input type="hidden" name="barcode" id="barcode" value="1" />
	  {[if $result.status eq 1 and $status eq '2']}
	  <input type="button" value="开始质检" name="B1" onclick="list_start('{[$root]}?do=Barcode.produce{[$p2]}&id={[$result.id]}&status=2', ''); return false;">
	  {[/if]}

	  {[if ($result.status eq 2 or $result.status eq 3) and $status eq '3']}
	  <input type="button" value="质检合格" name="B1" onclick="dialog_quality_('{[$root]}?do=Quality.add&id={[$result.id]}&status=1', '添加质检报告', '600x400'); return false;">

	  <input type="button" value="质检异常" name="B1" onclick="dialog_quality_('{[$root]}?do=Quality.add&id={[$result.id]}&status=2', '添加质检报告', '600x400'); return false;">
	  {[/if]}
	  </td>
	</tr>
	{[/if]}
  </table>
</fieldset>

<script type="text/javascript" src="js/mold/produce/list.js?r={[$smarty.now]}"></script>